home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: Content/Frame/Part question
- Sent: 5/20/96 6:55 PM
- Received: 5/22/96 8:32 AM
- From: Serge Froment, sfroment@odyssee.net
- Reply-To: ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- >Is that the right idiom for "just in time" content updating, where it would
- >be too expensive and unnecessary for a frame to adjust the content with
- >each change the user makes? Or have I overlooked something you put in ODF
- >for R1?
-
- There are several way this can be done. Here is how I do it in my parts:
-
- - My view have an associated view-content class, which is a mixin that
- inherits FW_MNotifier and post notification anytime the content is
- modified.
-
- - My view inherit FW_MReceiver, display the associated view-content class,
- and register to notifications posted by this class in the CreateSubViews
- method.
-
- - My FW_CContent class inherit one or several view-content classes.
-
- - On DoMouseDown or other appropriate places, my view creates a FW_CCommand
- object that track the change and directly modify the view-content class.
-
- - The view-content class then post notification so all views displaying the
- data can synchronize to the changes.
-
- The benefits of this approach is that there is very few dependencies in the
- code:
-
- - Only the view knows about the view-content data being displayed.
- - The frame knows nothing about the view and the view-content data except
- when it creates the subviews.
- - The part knows nothing about the view-content data except in
- internalize/externalize, where it merely calls
- MViewContent::Internalize/Externalize.
- - I don't need to iterate through all frames to make sure the "view in
- window" is synchronized.
- - The view class as well as the view-content class can be reused in several
- OpenDoc parts.
- - If the same data is displayed at more places, I don't have to update
- existing code. All those new views will be synchronized as well.
-
- Serge
-
-